#!/bin/bash
#

read -p "输入行数：" n

#正三角
for ((i=1; i<n; i++)); do
    for ((j=1; j<=n-i; j++));do
	echo -n "  "
    done
    for ((k=1; k<=2*i-1; k++));do
	echo -n "* "
    done
    echo
done

#倒三角
for((i=1;i<=n;i++));do
    for((k=1;k<=i-1;k++));do
	echo -n "  "
    done
    for((j=1;j<=2*(n-i)+1;j++));do
	echo -n "* "
    done
    echo
done
